# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=dkfilter
pkgver=0.11
pkgrel=13
pkgdesc="Domain key filter"
arch=('any')
url="http://jason.long.name/dkfilter/"
license=('GPL')
depends=(perl-crypt-openssl-rsa perl-mailtools perl-net-dns perl-net-server perl-mail-domainkeys)
options=('!emptydirs')
backup=(etc/conf.d/dkfilter)
install=dkfilter.install
source=(http://jason.long.name/dkfilter/dkfilter-$pkgver.tar.gz
	dkfilter-in.service
	dkfilter-out.service
	dkfilter.conf.d)
md5sums=('e295678fc728c139137bfadf4a679262'
         '550ef7abc5dd6a5610dd6ef7f4ab5fee'
         '4baff6ebf7d8da2b390e1ad49fc041b5'
         'a2fb031fa9493ccc082d953cd023a097')
sha256sums=('9b08a2640ce5a8fdc9a8dad96c0d2c6364bd45396938925b7ae661b43ea83756'
            'ae337018e3058992ecbbb80af659b72596eb174777cc465665850f6cf78c8fb1'
            '870d46a17712d3dca7b92a6c3d8d7a2c85132c04c932671ecf418a0a2cf5df02'
            '4abc3b392a6f4403b0240e9988727b8a5f5feabf95b1cb942034dec761707cee')

build() {
  cd  "$srcdir"/dkfilter-$pkgver
  ./configure --prefix=/usr
  make
}

package() {
  cd  "$srcdir"/dkfilter-$pkgver
  make DESTDIR="$pkgdir" install
  install -D -m 0644 "$srcdir"/dkfilter.conf.d "$pkgdir"/etc/conf.d/dkfilter

  install -Dm0644 "$srcdir"/$pkgname-in.service "$pkgdir"/usr/lib/systemd/system/$pkgname-in.service
  install -Dm0644 "$srcdir"/$pkgname-out.service "$pkgdir"/usr/lib/systemd/system/$pkgname-out.service
}
